#include <stdio.h>

int reverse( int number );
    
int main()
{
    int n;

    scanf("%d", &n);
    printf("%d\n", reverse(n));

    return 0;
}


int reverse( int number ){
	int num,t;
	num = 0;
	if(number>=0){
		while(number>0){
			t  = number%10;
			num = num*10+t;
			number = number/10;
		}
	}else{
		number = 0-number;
		while(number>0){
			t  = number%10;
			num = num*10+t;
			number = number/10;}
		num = 0-num;
	}return num;
}
